<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('预报名管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>学生姓名：</label>
                                <input type="text" name="stuName"/>
                            </li>

                            <li>
                                <label>学生状态：</label>
                                <select name="stuStatus" th:with="type=${@dict.getType('sys_stu_Status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>

                            <li>
                                <label>手机号：</label>
                                <input type="text" name="stuTel"/>
                            </li>

                            <li>
                                <label>学生籍贯：</label>
                                <input type="text" name="stuNative"/>
                            </li>

                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:Forecastname:add">
                    <i class="fa fa-plus"></i> 添加预报名学生
                </a>

            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:Forecastname:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:Forecastname:remove')}]];
        var stuStatusDatas = [[${@dict.getType('sys_listen_Status')}]];
        var prefix = ctx + "system/Forecastname";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                xupdateStatus:prefix+"/Status",
                updateStatuss:prefix+"/Statuss",

                exportUrl: prefix + "/export",
                modalName: "预报名管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'stuId',
                    title: '学生id',
                    visible: false
                },
                {
                    field: 'stuName',
                    title: '学生姓名'
                },
                {
                    field: 'stuSex',
                    title: '性别'
                },
                {
                    field: 'stuStatus',
                    title: '学生状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(stuStatusDatas, value);
                    }
                },
                {
                    field: 'stuTime',
                    title: '报名时间'
                },
                {
                    field: 'stuTel',
                    title: '学生手机号'
                },
                {
                    field: 'stuIdentity',
                    title: '学生身份证'
                },
                {
                    field: 'stuNative',
                    title: '学生籍贯'
                },
                {
                    field: 'stuRemarks',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="#" id="updateStatus" onclick="$.operate.xupdateStatus(\'' + row.stuId +'\',\'' + row.stuName +'\',\'' + row.stuSex +'\',\'' + row.stuStatus +'\',\'' + row.stuIdentity +'\',\'' + row.stuNative +'\',\'' + row.stuTel +'\')"><i class=""></i>转试听</a> ');
                        actions.push('<a class="btn btn-success btn-xs" href="#" id="updateStatus" onclick="$.operate.updateStatuss(\'' + row.stuId + '\',\'' + row.stuName +'\',\'' + row.stuSex +'\',\'' + row.stuStatus +'\',\'' + row.stuIdentity +'\',\'' + row.stuNative +'\',\'' + row.stuTel +'\')"><i class=""></i>转正式</a> ');

                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.stuId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.stuId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>